package Remote;

import Commands.*;
import Devices.*;

public class Main {

    public static void main(String[] args) {
        //Initialize remote control object
        RemoteControl rc = new RemoteControl();
        //Initialize Device objects
        Tv tv = new Tv();
        CeilingLight ceilingLight = new CeilingLight();
        GarageDoor garageDoor = new GarageDoor();
        //Initialize Commands
        CeilingLightDimCommand dimCeilingLight = new CeilingLightDimCommand(ceilingLight);
        CeilingLightOffCommand ceilingLightOff = new CeilingLightOffCommand(ceilingLight);
        CeilingLightOnCommand ceilingLightOn = new CeilingLightOnCommand(ceilingLight);

        GarageDoorDownCommand garageDoorDown = new GarageDoorDownCommand(garageDoor);
        GarageDoorLightOffCommand garageLightOff = new GarageDoorLightOffCommand(garageDoor);
        GarageDoorLightOnCommand garageLightOn = new GarageDoorLightOnCommand(garageDoor);
        GarageDoorStopCommand garageDoorStop = new GarageDoorStopCommand(garageDoor);
        GarageDoorUpCommand garageDoorUp = new GarageDoorUpCommand(garageDoor);

        TvOffCommand tvOff = new TvOffCommand(tv);
        TvOnCommand tvOn = new TvOnCommand(tv);
        TvSetInputChannelCommand tvSetChannel = new TvSetInputChannelCommand(tv);
        TvSetVolumeCommand tvSetVolume = new TvSetVolumeCommand(tv);

        //Assigning commands to buttons
        rc.setCommand(0, dimCeilingLight);
        rc.setCommand(1, tvOn);
        rc.setCommand(2, tvOff);
        rc.setCommand(3, tvSetChannel);
        rc.setCommand(4, tvSetVolume);
        rc.setCommand(5, garageLightOff);
        rc.setCommand(6, garageLightOn);
        rc.setCommand(8, tvOn);
        rc.setCommand(9, tvOff);


        rc.buttonWasPushed(0);
        rc.buttonWasPushed(3);
        rc.buttonWasPushed(8);
        rc.buttonWasPushed(7);
        rc.buttonWasPushed(2);

        rc.setCommand(8, garageDoorStop);
        rc.setCommand(9, garageDoorUp);

        rc.buttonWasPushed(8);
        rc.buttonWasPushed(9);
    }
}
